package model;
import java.util.Random;

/**
 * Dice class. One object represents one dice. 
 * @author Group 20
 */
public class Dice 
{
	/**
	 * Current dice face value
	 */
	private int faceValue; // Dice face value
	
	/**
	 * Random object. Used to create a random number.
	 */
	private Random randomNumber = new Random(); // New random number object
	
	/*
	 * Roll the dice. Save value.
	 */
	public void roll() // Roll dice and save the new face value
	{
		faceValue = randomNumber.nextInt(6) + 1; // Get random number between 1-6
	}
	
	/**
	 * Get the current face value.
	 * @return Current face value.
	 */
	public int getFaceValue() // Return the face value
	{
		return faceValue;
	}
	
	public String toString() // Convert the integer face value to string and return
	{
		return "" + faceValue;
	}
}

